/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package cn.edu.ecnu.gis.client.gadgets;

import cn.edu.ecnu.gis.client.MashupGISEntryPoint;
import cn.edu.ecnu.gis.client.model.Gadget;
import cn.edu.ecnu.gis.client.model.GadgetClass;
import com.google.gwt.user.client.ui.AbstractImagePrototype;
import com.google.gwt.user.client.ui.Grid;
import com.mapitz.gwt.googleMaps.client.GLatLng;


/**
 *
 * @author meflyup
 */
public class DataListGadget extends Gadget {
  private  Grid dataTable = new Grid(5,5); 
  private String userDataPoint="";
    public static class Class extends GadgetClass {

        public Class() {
            super("数据列表", false);
        }

        public Gadget newGadget() {
            return new DataListGadget(this);
        }
    }

    protected DataListGadget(Class c) {
       super(c);
       this.initWidget(dataTable);
       dataTable.setText(0, 0, "userDataPoint");
       dataTable.setText(1, 0, "userDataPoint2");
        try {
                GoogleMapsGadget2 googleMapsGadget = (GoogleMapsGadget2) MashupGISEntryPoint.widgetsList.get("地图");
                // GadgetClass gadgetClass1 = (GadgetClass) GadgetClass.getClasses().get(3);
                //GoogleMapsGadget googleMapsGadget=(GoogleMapsGadget)gadgetClass1;
                double lon = 31.22;
                double lan =121.48;
                googleMapsGadget.getGMap().setCenter(new GLatLng(lon,lan),14);
               // getService().myMethod(wsreturn.getText(), callback);
            } catch (Exception ex) {
                ex.printStackTrace();
            }
    }

    
    public AbstractImagePrototype getBoundImage() {
        throw new UnsupportedOperationException("Not supported yet.");
    }
}
